package com.ruoyi.project.mydy.havingwatch.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mydy.havingwatch.mapper.DlHavingWatchMapper;
import com.ruoyi.project.mydy.havingwatch.domain.DlHavingWatch;
import com.ruoyi.project.mydy.havingwatch.service.IDlHavingWatchService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 我的已看Service业务层处理
 * 
 * @author mhg
 * @date 2021-10-07
 */
@Service
public class DlHavingWatchServiceImpl implements IDlHavingWatchService 
{
    @Autowired
    private DlHavingWatchMapper dlHavingWatchMapper;

    /**
     * 查询我的已看
     * 
     * @param id 我的已看主键
     * @return 我的已看
     */
    @Override
    public DlHavingWatch selectDlHavingWatchById(Long id)
    {
        return dlHavingWatchMapper.selectDlHavingWatchById(id);
    }

    /**
     * 查询我的已看列表
     * 
     * @param dlHavingWatch 我的已看
     * @return 我的已看
     */
    @Override
    public List<DlHavingWatch> selectDlHavingWatchList(DlHavingWatch dlHavingWatch)
    {
        return dlHavingWatchMapper.selectDlHavingWatchList(dlHavingWatch);
    }

    /**
     * 新增我的已看
     * 
     * @param dlHavingWatch 我的已看
     * @return 结果
     */
    @Override
    public int insertDlHavingWatch(DlHavingWatch dlHavingWatch)
    {
        dlHavingWatch.setCreateTime(DateUtils.getNowDate());
        return dlHavingWatchMapper.insertDlHavingWatch(dlHavingWatch);
    }

    /**
     * 修改我的已看
     * 
     * @param dlHavingWatch 我的已看
     * @return 结果
     */
    @Override
    public int updateDlHavingWatch(DlHavingWatch dlHavingWatch)
    {
        return dlHavingWatchMapper.updateDlHavingWatch(dlHavingWatch);
    }

    /**
     * 批量删除我的已看
     * 
     * @param ids 需要删除的我的已看主键
     * @return 结果
     */
    @Override
    public int deleteDlHavingWatchByIds(String ids)
    {
        return dlHavingWatchMapper.deleteDlHavingWatchByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除我的已看信息
     * 
     * @param id 我的已看主键
     * @return 结果
     */
    @Override
    public int deleteDlHavingWatchById(Long id)
    {
        return dlHavingWatchMapper.deleteDlHavingWatchById(id);
    }
}
